<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="css/bootstrap.min.css" rel="stylesheet" media="screen">
<title>增加一个征集</title>
</head>
<body>
	<s:form name="f1" action="coach_add" method="post" onsubmit="return check()">
		<tr><td>姓名:</td><td><input type="text" name="name">
		<font color="red">*</font></td></tr>
		<tr><td>密码:</td><td><input type="password" name="password">
		<font color="red">*</font></td></tr>
		<tr><td>身份证:</td><td><input type="text" name="idCard">
		<font color="red">*</font></td></tr>
		<tr><td>地址:</td><td><textarea cols="20" rows="3" name="address"></textarea>
		<font color="red">*</font></td></tr>
		<tr><td>出生日期</td><td><input type="date" name="age">
		<font color="red">*</font></td></tr>
		<tr><td>性别：</td><td>
		<input type="radio" name="sex" value="1" />男
    	<input type="radio" name="sex" value="0" checked="checked" />女
		<font color="red">*</font></td></tr>
		<tr><td>电话号码:</td><td><input type="text" name="phoneNum">
		<font color="red">*</font></td></tr>
		<tr><td><input type="submit" value="提交" class="btn btn-info"/></td>
		<td><input type="reset" value="重置" class="btn btn-info"/></td></tr>
	</s:form>

<script type="text/javascript">
   	function check(){
		var name = document.f1.name;
		var password = document.f1.password;
		var idCard = document.f1.idCard;
		var address = document.f1.address;
		var age = document.f1.age;
		var sex = document.f1.sex;
		var phoneNum = document.f1.phoneNum;
		var reNum =/^[0-9]+$/;
		if(name.value==""||password.value==""||idCard.value==""||sex.value==""
		||age.value==""||phoneNum.value==""||address.value==""){
			alert("必填项不能为空！");
			return false;
		}
		if(!reNum.test(phoneNum.value)){
			alert("“电话号码与年龄必须为数字！");
			return false;
		}
		
		else{
			return true;
		}
	}
    </script>
</body>
</html>